package com.tmy.sst.config.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class TokenStoreConfig {
    @Autowired
    private DataSource dataSource;
    @Bean(name = "myMemoryTokenStore")
    public org.springframework.security.oauth2.provider.token.TokenStore myMemoryTokenStore() {
//        return new InMemoryTokenStore();
        return  new JdbcTokenStores(dataSource);
    }
}
